<template>
  <el-main>
	<div class="title"> ——&nbsp; 推荐商家 &nbsp;——</div>
	<div class="filter-header" :class="{fixedfilter:isFixed}">
		<div class="child" :class="{fontbolderblue:index === 1}" @click="fontbolderblue(1);showfiltermenuxl()" :index="1">
			{{this.filterorder[filorderactived]}}
			<i class="el-icon-caret-bottom"></i>
		</div>
		<div class="child" @click="fontbolder();selectfilorder(3)" :class="{fontbolder:isBolder}">距离最近</div>
		<div class="child" onclick="alert('暂未开放领红包！')">
			<i class="iconfont" style="color:#FFD700;">&#xe6b4;</i>
			会员领红包
		</div>
		<div class="child" @click="showfiltermenu();fontbolderblue(4)" :class="{fontbolderblue:index === 4}" :index="4">筛选
			<i class="iconfont">&#xe627;</i>
		</div>
	</div>
	<div class="filtermenu xlmenu" :class="{showheight:isShowheightxl}">
		<ul>
			<li v-for="(oitem,index) in filterorder" @click="selectfilorder(index)">{{oitem}}</li>
		</ul>
	</div>
	<div class="filtermodal" v-show="isShowblackbg" @click="closeblackbg()"></div>
	<div class="filtermenu" :class="{showheight:isShowheight}">
		<p style="padding:15px;">商家服务(可多选)</p>
		<el-row :gutter="24">
			<el-col :span="8" v-for="(eitem,index) in businessservice" :key="eitem.id">
				<div class="grid-content" @click="radiobg(eitem);isqkactiveds();getstoreservice(index)" :class="{gridcbg:isGridcbg===eitem.state}">
					<img class="morefilterimg" :src="eitem.imgUrl">
					<span>{{eitem.name}}</span>
				</div>
			</el-col>
		</el-row>
		<p style="padding:15px;">优惠活动(单选)</p>
		<el-row :gutter="24">
			<el-col :span="8" v-for="(citem,index) in preferencelist" :key="citem.id">
				<div class="grid-content" @click="radiobgpre(index);isqkactiveds();getpreferenceActivity(index)" :class="{gridcbg:isGridcbgpre===index}">{{citem.name}}</div>
			</el-col>
		</el-row>
		<p style="padding:15px;">人均消费</p>
		<el-row :gutter="24">
			<el-col :span="8" v-for="(pitem,index) in pricesection" :key="pitem.id">
				<div class="grid-content" @click="radiobgxf(index);isqkactiveds()" :class="{gridcbg:isGridcbgxf===index}">{{pitem.name}}</div>
			</el-col>
		</el-row>
		<div class="morefilterbtns">
			<span class="morefilterclear" :class="{qkactived:isQkactived}"
			@click="clearactived">清空</span>
			<span class="morefilteractive morefilteropac" @click="confirmselect()">确定</span>
		</div>
	</div>
	<!-- :to="'/detail/' + item.id + '/' +item.name" -->
	<div style="padding-bottom:350px;width:100%;float:left;">
		<!-- <router-link tag="div" :to="'/detail/' + item.id + '/' +item.name" class="filter-ctain" style="position:relative;" v-for="(item,index) in storelist" :key="item.id"> -->
		<div @click="toDetailpage(item.id,item.name,item.imgUrl)" class="filter-ctain" style="position:relative;" v-for="(item,index) in storelist" :key="item.id">
			<div class="shadowdislike" v-show="item.shadowstate" @click="unshows(item)">
				<div class="disliker">不喜欢</div>
			</div>
			<div class="info">
				<div class="goodsimg">
					<div class="newstore" v-if="item.newstore"><span>新店</span></div>
					<img :src="item.imgUrl" alt="">
				</div>
				<div class="titleinfo">
					<div class="titlename"><span class="brand" v-if="item.brand">品牌</span>{{item.name}}<span class="dislike" @click="showdislike(item)">...</span></div>
					<div style="padding-left:14px;position:relative;">
						<div class="starimg">						
						</div>
						<div class="goldstar" :style="{width:(item.stars)*12.8+'px'}"></div>	
						{{Math.floor((item.stars)*10)/10}} &nbsp;&nbsp;月售{{item.sales}}单
					</div>
					<div style="text-indent:14px;">
						¥15起送 | <span v-if="item.distance > 2.5">远距离</span>配送费¥{{item.expense}} <span class="dislike">{{item.distance}}km | {{item.spendtime}}分钟</span>
					</div>
				</div>
				<div v-if="item.trochilus" style="padding:1px;color:#fff;background-color:#0097ff;position:absolute;top:30px;right:10px;">蜂鸟专送</div>
			</div>
			<div class="activity" :class="{activspread:item.state}">
				<div style="text-indent:14px;padding-bottom:14px;border-bottom:solid 1px #e8e8e8;
				margin-bottom:14px;margin-top:8px;">
					<span class="tag">{{item.tag}}</span>
					<span class="koubei"><i class="iconfont">&#xe673;</i> 口碑人气好店</span>
				</div>
				<!-- @click.stop="stopPropagation"组织事件冒泡 -->
				<span class="dislike" @click="spreadacti(item)" @click.stop="stopPropagation">
					{{item.activity.length}}个活动
					<i class="el-icon-caret-bottom" style="text-indent: 0;" v-show="item.state"></i>
					<i class="el-icon-caret-top" style="text-indent: 0;" v-show="!item.state"></i>
				</span>			
				<div class="zengshow" style="text-indent:14px;padding-bottom:14px;"
				v-for="aitem of item.activity">
					<span class="man" :style="{background:aitem.color}">{{aitem.initial}}</span> &nbsp;
					<span class="omit">{{aitem.text}}</span>
				</div>	
			</div>
		<!-- </router-link> -->
		</div>
	</div>
  </el-main>

</template>
<script>
export default{
	name:'HomeBanner',
	props: {
		list: Array,
		statustopts: String,
	},
	data () {
		return {
			theListorder:'',
			isShowacti:true,
			isStarprc:false,
			isFixed:false,		
			isShowheight:true,
			isBolder:false,	
			index:0,
			isShowheightxl:true,
			isShowblackbg:false,
			filorderactived:0,
			isGridcbg:false,
			isGridcbgxr:0,
			isGridcbgpre:-1,
			isGridcbgxf:-1,
			isQkactived:false,
			storeServiceArray:[],
			preferenceActivityArray:[],
			startfilter:0,
			doubleChecking1:false,
			doubleChecking2:false,
			doubleChecking3:false,
			filterorder:['综合排序','好评优先','销量最高','配送最快','配送费最低'],
			businessservice:[{"id":"001","state":true,"name":"蜂鸟专送","imgUrl":"https://fuss10.elemecdn.com/b/9b/45d2f6ff0dbeef3a78ef0e4e90abapng.png?imageMogr/format/webp/thumbnail/!24x24r/gravity/Center/crop/24x24/"},{"id":"002","state":true,"name":"品牌商家","imgUrl":"https://fuss10.elemecdn.com/6/7c/417ba499b9ef8240b8014a453bf30png.png?imageMogr/format/webp/thumbnail/!24x24r/gravity/Center/crop/24x24/"},{"id":"003","state":true,"name":"新店","imgUrl":"https://fuss10.elemecdn.com/c/93/ded991df780906f7471128a226104png.png?imageMogr/format/webp/thumbnail/!24x24r/gravity/Center/crop/24x24/"}],
			preferencelist:[{"id":"001","state":false,"name":"首单立减"},{"id":"002","state":false,"name":"门店新客立减"},{"id":"003","state":false,"name":"满减优惠"},{"id":"004","state":false,"name":"赠品优惠"},{"id":"005","state":false,"name":"特价商品"},{"id":"006","state":false,"name":"折扣商品"}],
			pricesection:[{"id":"001","state":false,"name":"¥20以下"},{"id":"002","state":false,"name":"¥20 - ¥40"},{"id":"003","state":false,"name":"¥40 - ¥60"},{"id":"004","state":false,"name":"¥60 - ¥80"},{"id":"005","state":false,"name":"¥80 - ¥100"},{"id":"006","state":false,"name":"¥100以上"}]
		}
	},
	methods: {
		stopPropagation (event) {
		    if(event) {
		        event.stopPropagation ? event.stopPropagation(): event.cancelBubble = true;
		    }
		},
		// 下面的每个函数传进的索引值对应着页面菜单按钮中的选项顺序

		fontbolder () {
			this.isBolder = !this.isBolder
			if (this.isBolder == true) {
				this.index = 0
			}
			this.isShowheight = true
		},
		fontbolderblue (e) {
			if (e == 4 && this.isShowheight == true) {
				return this.index = false
			}
			if (e == 1 && this.isShowheightxl == false) {				
				return this.index = false
			}		
			this.isBolder = false	
			this.index = e
		},
		closeblackbg () {
			this.index = 0
			this.isShowblackbg = false
			this.isShowheight = true
			this.isShowheightxl = true
		},
		spreadacti (item) {
			item.state = !item.state
		},
		showdislike (item) {
			item.shadowstate = !item.shadowstate		
		},
		unshows (item) {
			item.shadowstate = !item.shadowstate
		},
		showtsClass () {
			if (this.statustopts === '1') {
				this.isFixed = true			
			}else if (this.statustopts === '0') {
				this.isFixed = false
			}			
		},
		showfiltermenu () {
			this.$emit('acceptfiltback')	
			eventBus.$emit('acceptsearchcome')
			this.isFixed = true
			this.isShowheight = !this.isShowheight
			this.isShowheightxl = true
			if (this.isShowblackbg == true) {
				this.isShowblackbg = true
			}
			if (this.isShowblackbg == false) {
				this.isShowblackbg = true
			}
			if (this.isShowheight == true) {
				this.isShowblackbg = false
			}
		},
		showfiltermenuxl () {
			this.$emit('acceptfiltback')
			eventBus.$emit('acceptsearchcome')
			this.isFixed = true			
			this.isShowheight = true
			this.isShowheightxl = !this.isShowheightxl
			if (this.isShowblackbg == true) {
				this.isShowblackbg = true
			}
			if (this.isShowblackbg == false) {
				this.isShowblackbg = true
			}
			if (this.isShowheightxl == true) {
				this.isShowblackbg = false
			}
		},
		selectfilorder (e) {
			// let data = e 发送参数至父组件先这样定义
			// this.$emit('sendfilterorder',data)
			this.filorderactived = e
			this.isShowblackbg = false			
			this.isShowheightxl = true
			if (e === 0) {
				this.theListorder = 0	
			}			
			if (e === 1) {
				this.theListorder = 1	
			}
			if (e === 2) {
				this.theListorder = 2
				// this.$options.methods.函数名(e) 跳转到某个函数		
			}
			if (e === 3) {
				this.theListorder = 3	
			}	
			if (e === 4) {
				this.theListorder = 4	
			}					
		},
		radiobg (e) {
			e.state = !e.state
			if (e.state == false) {
				this.isGridcbgxr = this.isGridcbgxr + 1				
			}else if (e.state == true) {
		 		this.isGridcbgxr = this.isGridcbgxr - 1
			}
		},
		radiobgpre (index) {
			if (this.isGridcbgpre != index) {
				this.isGridcbgpre = index
			}else {
				this.isGridcbgpre = -1
			}			
		},
		radiobgxf (index) {
			if (this.isGridcbgxf != index) {
				this.isGridcbgxf = index
			}else {
				this.isGridcbgxf = -1
			}	
		},
		isqkactiveds () {
			if (this.isGridcbgxr > 0 || this.isGridcbgpre > -1 || this.isGridcbgxf > -1) {
				this.isQkactived = true
			
			}else if (this.isGridcbgxr == 0 && this.isGridcbgpre == -1 && this.isGridcbgxf == -1) {
				this.isQkactived = false
			}
		},
		clearactived () {
			this.businessservice.forEach((item) => {
				item.state = true
			})
			this.isGridcbgpre = -1
			this.isGridcbgxf = -1
			this.isGridcbgxr = 0
			this.isQkactived = false
			this.storeServiceArray = []
			this.preferenceActivityArray = []
		},
		// 过滤器
		// even () {
		// 	return this.list.filter(function (number) {
		// 		return number.sales > 800
		// 	})
		// },	
		orderBykeyupdown (array,key) {
			return array.sort(function (a,b) {
				const x=a[key]
				const y=b[key]
				return ((x>y)?-1:((x<y)?1:0))//大到小排序
			})
		},
		orderBykeydownup (array,key) {
			return array.sort(function (a,b) {
				const x=a[key]
				const y=b[key]
				return ((x<y)?-1:((x>y)?1:0))//小到大排序
			})
		},
		getpreferenceActivity (e) {
			if (e === 0) {
				if (this.preferenceActivityArray.indexOf(0) > -1) {
					this.preferenceActivityArray.remove(0)
				}else {
					this.preferenceActivityArray = []
					this.preferenceActivityArray.push(e)				
				}
			}
			if (e === 1) {
				if (this.preferenceActivityArray.indexOf(1) > -1) {
					this.preferenceActivityArray.remove(1)
				}else {
					this.preferenceActivityArray = []
					this.preferenceActivityArray.push(e)					
				}
			}
			if (e === 2) {
				if (this.preferenceActivityArray.indexOf(2) > -1) {
					this.preferenceActivityArray.remove(2)
				}else {
					this.preferenceActivityArray = []
					this.preferenceActivityArray.push(e)					
				}
			}		
			if (e === 3) {
				if (this.preferenceActivityArray.indexOf(3) > -1) {
					this.preferenceActivityArray.remove(3)
				}else {
					this.preferenceActivityArray = []
					this.preferenceActivityArray.push(e)					
				}
			}
			if (e === 4) {
				if (this.preferenceActivityArray.indexOf(4) > -1) {
					this.preferenceActivityArray.remove(4)
				}else {
					this.preferenceActivityArray = []
					this.preferenceActivityArray.push(e)					
				}
			}
			if (e === 5) {
				if (this.preferenceActivityArray.indexOf(5) > -1) {
					this.preferenceActivityArray.remove(5)
				}else {
					this.preferenceActivityArray = []
					this.preferenceActivityArray.push(e)					
				}
			}
			// alert('数组'+' '+this.preferenceActivityArray+' '+'长度'+' '+this.preferenceActivityArray.length)		
		},
		getstoreservice (e) {
			if (e === 0 && this.doubleChecking1 === false) {
				this.doubleChecking1 = true
				this.storeServiceArray.push(e)
			}else if (e === 0 && this.doubleChecking1 === true) {
				this.doubleChecking1 = false
				this.storeServiceArray.remove(0) 
			}
			if (e === 1 && this.doubleChecking2 === false) {
				this.doubleChecking2 = true
				this.storeServiceArray.push(e)
			}else if (e === 1 && this.doubleChecking2 === true) {
				this.doubleChecking2 = false
				this.storeServiceArray.remove(1) 
			}
			if (e === 2 && this.doubleChecking3 === false) {
				this.doubleChecking3 = true
				this.storeServiceArray.push(e)
			}else if (e === 2 && this.doubleChecking3 === true) {
				this.doubleChecking3 = false
				this.storeServiceArray.remove(2) 
			}						
			// alert('数组'+' '+this.storeServiceArray+' '+'长度'+' '+this.storeServiceArray.length)
		},
		confirmselect () {
			this.theListorder = 8
			this.isShowheight = true	
			this.isShowblackbg = false
			this.index = 0
		},
		selectover () {

		},
		toDetailpage (eid,ename,eimg) {
			this.$router.push({name:'Detail',params:{id:eid,name:ename,img:eimg}})
		},
		clearRouter () {
			this.$router.go(0)
		},

		// init () {

		// },
	},
	filters: {
		xlmaxfilter (number) {
			return number > 800
		}
	},
	computed: {		
		storelist () {
			// 综合排序,好评优先,销量最高,配送最快,配送费最低
			if (this.theListorder === '') {
				return this.list
			}	
			if (this.theListorder === 1) {
				return this.orderBykeyupdown(this.list,'stars')
			}		
			if (this.theListorder === 2) {
				return this.orderBykeyupdown(this.list,'sales')
			}
			if (this.theListorder === 3) {
				return this.orderBykeydownup(this.list,'spendtime')
			}		
			if (this.theListorder === 4) {
				return this.orderBykeydownup(this.list,'expense')
			}	
			// 商家服务筛选
			if (this.theListorder === 8) {
				this.theListorder = ''
				// 筛选清空时返回默认
				if (this.storeServiceArray.length === 0 && this.preferenceActivityArray.length === 0) {
					return this.list
				}
				// > -1表示存在,== -1表示不存在
				//单独选商家服务--------------------------------------------------
				if (this.storeServiceArray.length > 0 && this.preferenceActivityArray.length === 0) {
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) == -1) {					
						return this.list.filter(function (number) {
							return number.trochilus > 0
						})
					}
					if (this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(2) == -1) {	
						return this.list.filter(function (number) {
							return number.brand > 0
						})
					}
					if (this.storeServiceArray.indexOf(2) > -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(0) == -1) {	
						return this.list.filter(function (number) {
							return number.newstore > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1) {	
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.brand > 0
						})
					}				
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.storeServiceArray.indexOf(1) == -1) {	
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.trochilus > 0
						})
					}
					if (this.storeServiceArray.indexOf(2) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(0) == -1) {	
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.brand > 0
						})
					}
					if (this.storeServiceArray.indexOf(2) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(0) > -1) {	
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.brand > 0 && number.trochilus > 0
						})
					}	
				}	
				//-------------------------------------------------------

				//单独选优惠活动----------------------------------
				if (this.storeServiceArray.length === 0 && this.preferenceActivityArray.length > 0) {
					if (this.preferenceActivityArray.indexOf(0) > -1) {
						return this.list.filter(function (number) {
							return number.activitysz.shou > 0
						})					
					}
					if (this.preferenceActivityArray.indexOf(1) > -1) {	
						return this.list.filter(function (number) {
							return number.activitysz.xin > 0
						})
					}	
					if (this.preferenceActivityArray.indexOf(2) > -1) {
						return this.list.filter(function (number) {
							return number.activitysz.man > 0
						})
					}	
					if (this.preferenceActivityArray.indexOf(3) > -1) {	
						return this.list.filter(function (number) {
							return number.activitysz.zeng > 0
						})
					}
					if (this.preferenceActivityArray.indexOf(4) > -1) {
						return this.list.filter(function (number) {
							return number.activitysz.te > 0
						})
					}	
					if (this.preferenceActivityArray.indexOf(5) > -1) {
						return this.list.filter(function (number) {
							return number.activitysz.zhe > 0
						})
					}	
				}
				//--------------------------------------						
				//优惠服务和商家活动一起选--------------------------------------
				if (this.storeServiceArray.length > 0 && this.preferenceActivityArray.length > 0) {
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(0) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.activitysz.shou > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(1) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.activitysz.xin > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(2) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.activitysz.man > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(3) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.activitysz.zeng > 0
						})
					}					
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(4) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.activitysz.te > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(5) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.activitysz.zhe > 0
						})
					}
					// ----------------------------------------------

					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(0) > -1) {				
						return this.list.filter(function (number) {
							return number.brand > 0 && number.activitysz.shou > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(1) > -1) {				
						return this.list.filter(function (number) {
							return number.brand > 0 && number.activitysz.xin > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(2) > -1) {				
						return this.list.filter(function (number) {
							return number.brand > 0 && number.activitysz.man > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(3) > -1) {				
						return this.list.filter(function (number) {
							return number.brand > 0 && number.activitysz.zeng > 0
						})
					}					
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(4) > -1) {				
						return this.list.filter(function (number) {
							return number.brand > 0 && number.activitysz.te > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(5) > -1) {				
						return this.list.filter(function (number) {
							return number.brand > 0 && number.activitysz.zhe > 0
						})
					}
					// ----------------------------------------------

					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(0) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.activitysz.shou > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(1) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.activitysz.xin > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(2) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.activitysz.man > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(3) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.activitysz.zeng > 0
						})
					}					
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(4) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.activitysz.te > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) == -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(5) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.activitysz.zhe > 0
						})
					}
					// -------------------------------------
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(0) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.brand > 0 && number.activitysz.shou > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(1) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.brand > 0 && number.activitysz.xin > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(2) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.brand > 0 && number.activitysz.man > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(3) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.brand > 0 && number.activitysz.zeng > 0
						})
					}					
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(4) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.brand > 0 && number.activitysz.te > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) == -1 && this.preferenceActivityArray.indexOf(5) > -1) {				
						return this.list.filter(function (number) {
							return number.trochilus > 0 && number.brand > 0 && number.activitysz.zhe > 0
						})
					}
					// -------------------------------------
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(0) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.brand > 0 && number.activitysz.shou > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(1) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.brand > 0 && number.activitysz.xin > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(2) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.brand > 0 && number.activitysz.man > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(3) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.brand > 0 && number.activitysz.zeng > 0
						})
					}					
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(4) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.brand > 0 && number.activitysz.te > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) == -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(5) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.brand > 0 && number.activitysz.zhe > 0
						})
					}
					// -------------------------------------
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(0) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.trochilus > 0 && number.brand > 0 && number.activitysz.shou > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(1) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.trochilus > 0&& number.brand > 0 && number.activitysz.xin > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(2) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.trochilus > 0&& number.brand > 0 && number.activitysz.man > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(3) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.trochilus > 0&& number.brand > 0 && number.activitysz.zeng > 0
						})
					}					
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(4) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.trochilus > 0&& number.brand > 0 && number.activitysz.te > 0
						})
					}
					if (this.storeServiceArray.indexOf(0) > -1 && this.storeServiceArray.indexOf(1) > -1 && this.storeServiceArray.indexOf(2) > -1 && this.preferenceActivityArray.indexOf(5) > -1) {				
						return this.list.filter(function (number) {
							return number.newstore > 0 && number.trochilus > 0&& number.brand > 0 && number.activitysz.zhe > 0
						})
					}

				}
			}
		}
	},
	watch: {
		statustopts (statustopts) {
			this.showtsClass()
		},
	    // '$route' (to, from) {
	    //   this.init()
	    // },
		
	},
	mounted () {
		// this.even()
	}
}
// 构造一个通过元素值来删除数组元素的函数 array.remove('val')
Array.prototype.indexOf = function(val) {
	for (var i = 0; i < this.length; i++) {
		if (this[i] == val) return i;
	}
	return -1;
};
Array.prototype.remove = function(val) {
	var index = this.indexOf(val);
	if (index > -1) {
		this.splice(index, 1);
	}
};	
</script>
<style lang="stylus" scoped>
.qkactived
 color:#333!important;
.gridcbg
 color: #3190e8;
 background-color: #edf5ff!important;
.xlmenu
 padding:15px;
 z-index:22;
.xlmenu li
 line-height:40px;
.fontbolderblue
 color:#3190e8!important;
 font-weight:700; 
.fontbolder
 font-weight:700;
 color:#000!important;
.el-row
 padding:0 15px;
.filtermodal 
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index:30;
    background: rgba(0,0,0,.5);
.showheight
	height:0;
	overflow:hidden;
	padding:0;
.filtermenu
	width:100%;
	position:absolute;
	top:105px;
	z-index:31;
	background:#fff;
	margin-left: -10px;
.el-col
	padding:0 6px!important;
.grid-content
	background: #fafafa;
	font-size:14px
	padding:10px;
	text-align:center;
	margin-bottom:12px;
.omit
	width:200px;
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
	display:inline-block;
	text-indent:0;
.koubei
	color:#e8470b;
	padding-left:80px;
.koubei i
	color:#e8470b;
	font-size:12px;	
.zengshow
	display:block;
.dislike
	color:#666;
	font-size:12px;
	position:absolute;
	right:10px;
.titleinfo div
	margin-bottom:12px;
.titleinfo .titlename
	font-size:18px;
	color:#000;
	text-align:left;
	font-weight:600;
	text-indent:15px;
	line-height:18px
.titleinfo .titlename .brand
 padding:3px 4px;
 color: #6f3f15;
 font-weight: 700;
 background-color:#ffe339;
 font-size:14px;
.filter-ctain 
	padding-bottom:16px!important;
	border-bottom:solid 1px #E8E8E8;
.filter-ctain .titleinfo
	font-size:12px;
	color:#666;
	float:left;
	height:72px;
.filter-ctain .goodsimg
	width:72px;
	height:72px;
	float:left;
	position:relative;
.filter-ctain .newstore
 position:absolute;    
 top: 0;
 left: 0;
 z-index: 29;
 width:36px;
 height:36px;
 background-image: -webkit-linear-gradient(315deg,#26ce61,#26ce61 50%,transparent 0);
 background-image: linear-gradient(135deg,#26ce61,#26ce61 50%,transparent 0);
.filter-ctain .newstore span
 color:#fff;
 position: absolute;
 top: 5px;
 left: 0px;
 display: block;
 color: #fff;
 font-weight: 700;
 font-size:12px;
 -webkit-transform: rotate(-45deg);
 transform: rotate(-45deg);
.filter-ctain .goodsimg img
	width:100%;
.filter-ctain
	width:100%;
	float:left;
	padding:10px 0;
.filter-ctain .info 
	position:relative;
	width:100%;
	float:left;
.filter-ctain .activity 
	color:#666;
	font-size:12px;
	margin-top:10px;
	padding-left:72px;
	width:100%;
	float:left;
.filter-ctain .activspread
	height:100px;
	overflow:hidden;
.filter-ctain .tag
	border:solid 1px #e8e8e8;
	padding:2px;	
.filter-ctain .man
	padding:2px;
	color:#fff;
	border-radius:2px;
.filter-ctain .te
	padding:2px;
	background-color:rgb(241, 136, 79);
	color:#fff;
	border-radius:2px;
.filter-ctain .zeng
	padding:2px;
	background-color:rgb(60, 199, 145);
	color:#fff;
	border-radius:2px;
.filter-header .child
	color:#666;
	float:left;
	width:25%;
	padding:8px 0;
	text-align:center;
.actived
	color:#000;
	font-weight:700;
.title
	font-size:18px;
	text-align:center;
	line-height:40px;
.el-main
	padding-top:0;
</style>